package com.cby.operation.pay.channel.alipay

import android.text.TextUtils

/**
 * Description:阿里支付结果实体类
 *
 * @author 陈宝阳
 * @create 2020/8/13 09:42
 */
class AliPayResult(rawResult: Map<String?, String?>?) {
    /**
     * @return the resultStatus
     */
    var resultStatus: String? = null

    /**
     * @return the result
     */
    var result: String? = null

    /**
     * @return the memo
     */
    var memo: String? = null
    override fun toString(): String {
        return ("resultStatus={" + resultStatus + "};memo={" + memo
                + "};result={" + result + "}")
    }

    init {
        rawResult?.let {
            for (key in it.keys) {
                when {
                    TextUtils.equals(key, "resultStatus") -> {
                        resultStatus = rawResult[key]
                    }
                    TextUtils.equals(key, "result") -> {
                        result = rawResult[key]
                    }
                    TextUtils.equals(key, "memo") -> {
                        memo = rawResult[key]
                    }
                }
            }
        }

    }
}